Skip to content

Report the time to first token of the spring-ai-1.x plugin in gen_ai.response.time_to_first_chunk - #851

Open
peachisai wants to merge 2 commits into
apache:mainfrom
peachisai:fix/spring-ai-time-to-first-chunk
Open

peachisai wants to merge 2 commits into
apache:mainfrom
peachisai:fix/spring-ai-time-to-first-chunk

Conversation

@peachisai

Copy link
Copy Markdown
Member

Report the time to first token of the spring-ai-1.x plugin in gen_ai.response.time_to_first_chunk

The OpenTelemetry GenAI semantic conventions define gen_ai.response.time_to_first_chunk, in seconds, as the span attribute for the time to the first chunk of a streaming response. gen_ai.server.time_to_first_token, which the plugin reported with a value in milliseconds, is the name of a metric there, not of a span attribute.

  • The spring-ai-1.x plugin now reports gen_ai.response.time_to_first_chunk in seconds, such as 0.457.
  • Tags.GEN_AI_SERVER_TIME_TO_FIRST_TOKEN is renamed to Tags.GEN_AI_RESPONSE_TIME_TO_FIRST_CHUNK.
  • The expected data of the spring-ai-1.x-scenario plugin test follows the new tag.

The OAP side that reads the new tag is a separate pull request to apache/skywalking. It follows once this one is merged, because its e2e test runs the agent image built from this repository. An OAP that reads only the previous tag shows no time to first token for the calls this agent traces.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

…response.time_to_first_chunk

The OpenTelemetry GenAI semantic conventions define gen_ai.response.time_to_first_chunk,
in seconds, as the span attribute for it. gen_ai.server.time_to_first_token, which the
plugin used with a value in milliseconds, is the name of a metric there.

Tags.GEN_AI_SERVER_TIME_TO_FIRST_TOKEN is renamed to Tags.GEN_AI_RESPONSE_TIME_TO_FIRST_CHUNK.
@wu-sheng wu-sheng added this to the 9.9.0 milestone Nov 26, 2026
@wu-sheng

Copy link
Copy Markdown
Member

Please submit your pull request for OAP side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants